package ejb.dto;

import java.util.ArrayList;
import java.util.List;

import org.primefaces.model.UploadedFile;


public class PackageDTO {
	
	private int id;
	private String description;
	private LocationDTO location;
	private String name;
	private PeriodDTO period;
	private HotelDTO hotel;
	private ExcursionDTO excursion;
	private float minPrice;
	private List<HotelDTO> hotels;
	private List<ExcursionDTO> excursions;
	private List<FlightDTO> flights1;
	private List<FlightDTO> flights2;
	
	private int locationId;
	private int periodId;
	private int excursionId;
	private int hotelId;
	private String extra;
	
	private List<Integer> inwardFlightIds;
	private List<Integer> outwardFlightIds;
	private List<Integer> hotelIds;
	private List<Integer> excursionIds;
	private UploadedFile image;
	
	private FlightDTO suggestedFlight1;
	private FlightDTO suggestedFlight2;
	
	//GETTER AND SETTER
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public LocationDTO getLocation() {
		return location;
	}
	public void setLocation(LocationDTO location) {
		this.location = location;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public PeriodDTO getPeriod() {
		return period;
	}
	public void setPeriod(PeriodDTO period) {
		this.period = period;
	}
	public HotelDTO getHotel() {
		return hotel;
	}
	public void setHotel(HotelDTO hotel) {
		this.hotel = hotel;
	}
	public ExcursionDTO getExcursion() {
		return excursion;
	}
	public void setExcursion(ExcursionDTO excursion) {
		this.excursion = excursion;
	}
	public int getExcursionId() {
		return excursionId;
	}
	public void setExcursionId(int excursionId) {
		this.excursionId = excursionId;
	}
	public int getHotelId() {
		return hotelId;
	}
	public void setHotelId(int hotelId) {
		this.hotelId = hotelId;
	}
	public float getMinPrice() {
		return minPrice;
	}
	public void setMinPrice(float minPrice) {
		this.minPrice = minPrice;
	}
	
	public int getPeriodId() {
		return periodId;
	}
	public void setPeriodId(int periodId) {
		this.periodId = periodId;
	}
	public int getLocationId() {
		return locationId;
	}
	public void setLocationId(int locationId) {
		this.locationId = locationId;
	}

	public UploadedFile getImage() {
		return image;
	}
	public void setImage(UploadedFile image) {
		this.image = image;
	}
	public List<Integer> getHotelIds() {
		return hotelIds;
	}
	public void setHotelIds(List<String> hotelIds) {
		this.hotelIds = new ArrayList<Integer>();
		for(String s : hotelIds) {
			this.hotelIds.add(Integer.parseInt(s));
		}
	}
	public List<Integer> getExcursionIds() {
		return excursionIds;
	}
	public void setExcursionIds(List<String> excursionIds) {
		this.excursionIds = new ArrayList<Integer>();
		for(String s : excursionIds) {
			this.excursionIds.add(Integer.parseInt(s));
		}
	}
	public List<FlightDTO> getFlights1() {
		return flights1;
	}
	public void setFlights1(List<FlightDTO> flights1) {
		this.flights1 = flights1;
	}
	public List<FlightDTO> getFlights2() {
		return flights2;
	}
	public void setFlights2(List<FlightDTO> flights2) {
		this.flights2 = flights2;
	}
	public List<Integer> getOutwardFlightIds() {
		return outwardFlightIds;
	}
	public void setOutwardFlightIds(List<String> outwardFlightIds) {
		this.outwardFlightIds = new ArrayList<Integer>();
		for(String s : outwardFlightIds) {
			this.outwardFlightIds.add(Integer.parseInt(s));
		}
	}
	public List<Integer> getInwardFlightIds() {
		return inwardFlightIds;
	}
	public void setInwardFlightIds(List<String> inwardFlightIds) {
		this.inwardFlightIds = new ArrayList<Integer>();
		for(String s : inwardFlightIds) {
			this.inwardFlightIds.add(Integer.parseInt(s));
		}
	}
	public List<ExcursionDTO> getExcursions() {
		return excursions;
	}
	public void setExcursions(List<ExcursionDTO> excursions) {
		this.excursions = excursions;
	}
	public List<HotelDTO> getHotels() {
		return hotels;
	}
	public void setHotels(List<HotelDTO> hotels) {
		this.hotels = hotels;
	}
	public List<HotelDTO> getAllHotels() {
		List<HotelDTO> list = new ArrayList<HotelDTO>(hotels);
		list.add(hotel);
		return list;
	}
	public List<ExcursionDTO> getAllExcursions() {
		List<ExcursionDTO> list = new ArrayList<ExcursionDTO>(excursions);
		list.add(excursion);
		return list;
	}
	public String getExtra() {
		return extra;
	}
	public void setExtra(String extra) {
		this.extra = extra;
	}
	public FlightDTO getSuggestedFlight1() {
		return suggestedFlight1;
	}
	public void setSuggestedFlight1(FlightDTO suggestedFlight1) {
		this.suggestedFlight1 = suggestedFlight1;
	}
	public FlightDTO getSuggestedFlight2() {
		return suggestedFlight2;
	}
	public void setSuggestedFlight2(FlightDTO suggestedFlight2) {
		this.suggestedFlight2 = suggestedFlight2;
	}
}
